package com.vegetable.modules.service.finance;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vegetable.common.utils.R;
import com.vegetable.modules.entity.finance.Transactions;
import com.vegetable.modules.entity.finance.po.TransactionsQueryPO;
import com.vegetable.modules.entity.finance.po.TransactionsUpdatePO;
import com.vegetable.modules.entity.finance.vo.TradingFlowStatisticsVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ITransactionsService extends IService<Transactions> {
    R saveBatch(MultipartFile file, Long accountId) throws Exception;

    int saveBatch1(List<Transactions> transFlows) throws Exception;

    IPage<Transactions> queryList(TransactionsQueryPO po);

    List<TradingFlowStatisticsVO> statisticsFlow(TransactionsQueryPO po);

    Integer updateFlowBelong(TransactionsUpdatePO po) throws Exception;
    
    /**
     * 根据adId分页查询代办、农户的所有交易流水
     * @param adId 代办、农户ID
     * @param page 页码
     * @param limit 每页条数
     * @return 交易流水分页数据
     */
    IPage<Transactions> queryListByAdId(Long adId, Integer page, Integer limit);
}